#include <iostream>
#include <string>
#include <sys/resource.h>
#include <signal.h>
#include "spdlog/spdlog.h"
//#include "spdlogger_stream.h"
#include "log/log.h"

int main(int argc, char* argv[])
{
    std::cout << "Hello World" << std::endl;

    //gdb调试时不会忽略SIGPIPE信号，可以通过设置解决：handle SIGPIPE nostop noprint
    //Ignore SIGPIPE signal
    signal(SIGPIPE, SIG_IGN);
    //set core dump
	struct rlimit rlim_core;
	rlim_core.rlim_cur = RLIM_INFINITY;
	rlim_core.rlim_max = RLIM_INFINITY;
	setrlimit(RLIMIT_CORE, &rlim_core);

    struct rlimit rlim_nofile;
	rlim_nofile.rlim_cur = 64*1024;
	rlim_nofile.rlim_max = 640*1024;
	setrlimit(RLIMIT_NOFILE, &rlim_nofile);
    
    xffwcc::log::Logger::init_logger("../log/hello.log", false, 10, 5);
    LOG_INFO << "Hello World";
    //LOG_INFO() << "Hello World";

    return 0;
}
